Repository navigation
Read the column names from the first existing step 3 result file - #143
Merged
Merged
Conversation
_get_column_names read analysis/channelN/1_led_positions.csv, while create_binary_data leaves images without results out of the binary. An image that could not be read has no result file at all, so if image 1 was the unreadable one, --analysis stopped with a FileNotFoundError for that file instead of leaving the image out. The names are now read from the result file with the lowest image ID, and a channel without any result file raises a FileNotFoundError that says to run the data extraction first. The acceptance test takes the reference intensities from image 2, because image 1 is the default reference image and has no results in that test. Reported by Manuel Osburg in #131. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
_get_column_namesreads the column names of the step 3 result files fromanalysis/channelN/1_led_positions.csv, whilecreate_binary_dataleaves images without results out of the binary. An image that could not be read has no result file at all, so if image 1 is the unreadable one,--analysisstops before reaching the loop that would leave it out:Reported by Manuel Osburg in #131, who hit it while checking the interplay with #137. It is not specific to corrupted images: any channel whose lowest analysed image ID is not 1 runs into it.
Change
A new
_find_first_result_filecollects the image IDs of the{id}_led_positions.csvfiles of a channel, compares them as numbers (so 2 comes before 10) and returns the path of the lowest one._get_column_namesreads the names from that file. A channel without any result file now raises aFileNotFoundErrornaming the directory and saying to run the data extraction first, instead of numpy's bare1_led_positions.csv not found.The regex that matches the result files is duplicated from
_find_analysed_img_idsinstep_3_functions, which cannot be imported here because it importsread_tablefrom this module.Create And Fill Config Analysisgained anum_ref_imagesargument, which defaults to the 1 it used so far.Not covered: image 1 is also the default reference image. With
num_ref_images = 1and no results for image 1 the reference intensities come back empty, which this change does not address — whether a missing reference image should fall back or fail loudly is a separate question.Verification
07_test_corrupted_images.robotthat truncatestest_img_1.jpg, runs-s3_fastand--analysis, and asserts that the coefficients leave image 1 out while every remaining image keeps its own experiment time. It takes the reference from image 2, for the reason above.ledsa/tests/UnitTests/test_file_handling.py: numeric ordering of the IDs, a missing image 1, other files in the directory ignored, an empty channel, a missing channel directory, and_get_column_nameson a channel whose first result file is image 2.2_led_positions.csvraises theFileNotFoundErrorquoted above, and returns the column names with the change.🤖 Generated with Claude Code